package com.open4cn.simulator.answer.datacolor;

import com.open4cn.simulator.core.answer.AbstractAction;
import com.open4cn.simulator.core.ext.DataColorStatus;

/**
 * @author yinxiaopeng
 * @version 1.0.0
 * @company 致景科技
 * @department 飞梭BU/研发
 * @description
 * @Email yinxiaopeng@zj.tech
 * @date 2022-05-05 17:01
 */
public class RemoveSlotAction extends AbstractAction {

    public RemoveSlotAction() {
        super(null);
    }

    public RemoveSlotAction(AbstractAction action) {
        super(action);
    }

    @Override
    public void action(Object... params) {
        DataColorStatus dataColorStatus = (DataColorStatus) params[0];
        Integer slot = (Integer) params[1];
        dataColorStatus.changeCorrectionHistory(slot, DataColorStatus.EMPTY_CORRECTION_RECORD);
        if (hasNext()) {
            action.action(params);
        }
    }
}
